package com.lagou.edu.user.service;

import com.lagou.edu.user.service.impl.OAuthRemoteServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * feign调用oauth创建token服务
 *
 * @author lm
 * @since 2021/10/21 15:34
 */
@FeignClient(value = "edu-oauth-boot", fallback = OAuthRemoteServiceFallback.class)
@Primary
public interface OAuthRemoteService {
    @PostMapping("/oauth/token")
    String createToken(@RequestParam("username") String phone,
                       @RequestParam("password") String password,
                       @RequestParam("scope") String scope,
                       @RequestParam("grant_type") String grantType,
                       @RequestParam("client_id") String clientId,
                       @RequestParam("client_secret") String clientSecret,
                       @RequestParam(value = "auth_type", required = false) String authType);
}
